var fs = require('fs')
var zlib = require('zlib') //  压缩-解压缩模块


fs.createReadStream('test.txt')
.pipe(zlib.createGzip()) // 定义转换流的转换算法
.pipe(fs.createWriteStream('test.txt.gz'));

console.log("压缩完成");
